package com.xxwu.messagequeue.mqserver.mapper;

import com.xxwu.messagequeue.mqserver.core.Binding;
import com.xxwu.messagequeue.mqserver.core.Exchange;
import com.xxwu.messagequeue.mqserver.core.MSGQueue;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface MetaMapper {

    // 创建数据表，程序运行时，Mybatis 会自动创建数据库，无需手动创建
    Integer createExchangeTable();
    Integer createMSGQueueTable();
    Integer createBindingTable();

    // 对数据表进行增删
    Integer insertIntoExchange(Exchange exchange);
    List<Exchange> selectExchanges();
    Integer deleteExchange(String exchangeName);
    Integer insertIntoBinding(Binding binding);
    List<Binding> selectBindings();
    Integer deleteBinding(Binding binding);
    Integer insertIntoMSGQueue(MSGQueue msgQueue);
    List<MSGQueue> selectMsgQueues();
    Integer deleteMSGQueue(String msgQueueName);
}
